﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;

namespace DLM.Data.EF.CodeFirst
{
    public class DatabaseFactory : IDatabaseFactory
    {
        private DLMEntities dlmContext;

        public DbContext GetDataContext()
        {
            return dlmContext ?? (dlmContext = new DLMEntities());
        }

        public void Dispose()
        {
            if (dlmContext != null)
            {
                dlmContext.Dispose();
            }
        }
    }
}
